import request from '@/utils/request'

/**
 * 查询分区
 * @param data
 * @returns {AxiosPromise}
 */
export function saleDivisionPage(data) {
  return request({
    url: '/api/cms/sale_division/page',
    method: 'post',
    data
  })
}

/**
 * 新建销售分区
 * @param data
 * @returns {AxiosPromise}
 */
export function saleDivisionSave(data) {
  return request({
    url: '/api/cms/sale_division/save',
    method: 'post',
    data
  })
}

/**
 * 销售分区树形
 * @param data
 * @returns {AxiosPromise}
 */
export function saleDivisionSListTree(data) {
  return request({
    url: '/api/cms/sale_division/list_tree',
    method: 'post',
    data
  })
}

/**
 * 客户下拉表
 * @param data
 * @returns {AxiosPromise}
 */
export function customerList(data) {
  return request({
    url: '/api/cms/customer/list',
    method: 'post',
    data
  })
}

/**
 * 客户管理
 * @param data
 *@requires {AxiosPromise}
 */
export function customerPage(data) {
  return request({
    url: '/api/cms/customer/page',
    method: 'post',
    data
  })
}

/**
 * 查客户下过单的商品
 * @param data
 *@requires {AxiosPromise}
 */
export function goodsListAll(data) {
  return request({
    url: '/api/base/goods/list_all',
    method: 'post',
    data
  })
}

/**
 * 删除客户分区
 * @param data
 *@requires {AxiosPromise}
 */
export function saleDivisionDelete(data) {
  return request({
    url: '/api/cms/sale_division/delete',
    method: 'post',
    data
  })
}

/**
 * 销售分区编辑
 * @param data
 *@requires {AxiosPromise}
 */
export function saleDivisionUpdate(data) {
  return request({
    url: '/api/cms/sale_division/update',
    method: 'post',
    data
  })
}

/**
 * 新建客户
 * @param data
 *@requires {AxiosPromise}
 */
export function customerSave(data) {
  return request({
    url: '/api/cms/customer/save',
    method: 'post',
    data
  })
}

/**
 * 删除客户
 * @param data
 *@requires {AxiosPromise}
 */
export function customerDelete(data) {
  return request({
    url: '/api/cms/customer/delete',
    method: 'post',
    data
  })
}

/**
 * 编辑客户
 * @param data
 *@requires {AxiosPromise}
 */
export function customerUpdate(data) {
  return request({
    url: '/api/cms/customer/update',
    method: 'post',
    data
  })
}

